
// 状态转移方程
// f(n) = f(1) n <= 2
// f(n) = f(n-1) + f(n-2)
function Fibonacci (n) {
  if (n <= 2) return 1
  let dp = [1,1]
  let i = 2
  while (i < n) {
    dp[i] = dp[i - 1] + dp[i - 2]
    i++
  }
  return dp[n - 1]
}
console.log(Fibonacci(10))